package javacafe.action.factory;

import javacafe.action.Action;
import javacafe.action.ActionFactory;
import javacafe.action.main.CafeIntroAction;
import javacafe.action.main.CafeOrgAction;
import javacafe.action.main.IndexAction;
import javacafe.action.member.BeforeCustResiAction;
import javacafe.action.member.BeforeCustUpdateAction;
import javacafe.action.member.CustResiAction;
import javacafe.action.member.CustUpdateAction;
import javacafe.action.member.LoginAction;
import javacafe.action.member.LogoutAction;
import javacafe.action.vote.VoteFormAction;

public class IndexActionFactory implements ActionFactory {
	private static IndexActionFactory factory;
	
	public static IndexActionFactory getInstance(){
		if(factory==null){
			factory=new IndexActionFactory();
		}
		return factory;
	}

	public Action getAction(String command){
		Action action=null;
		if(command.equalsIgnoreCase("index")){
			action=new IndexAction();		
		} else if (command.equalsIgnoreCase("login")) {
			action = new LoginAction();
		} else if (command.equalsIgnoreCase("resiform")) {
			action = new BeforeCustResiAction();
		} else if (command.equalsIgnoreCase("memberupdateform")) {
			action = new BeforeCustUpdateAction(); 
		} else if (command.equalsIgnoreCase("updatemember")) {
			action = new CustUpdateAction();	
		} else if (command.equalsIgnoreCase("logout")) {
			action = new LogoutAction();
		} else if (command.equalsIgnoreCase("insertmember")) {
			action = new CustResiAction();
		} else if (command.equalsIgnoreCase("cafeintro")) {
			action = new CafeIntroAction();
		} else if (command.equalsIgnoreCase("cafeorg")) {
			action = new CafeOrgAction();
		}
		return action;
	}//
}
